import { DocAction, DocState } from "@/types"
import * as actionTypes from "./actionTypes";
const initState: DocState = {
  doc:{  
    content: '',
    uuid: '',
    docId: '',
    nextId: '',
    nextTitle: '',
    prevId:'',
    prevTitle: ''
  }
}

export default function reducer(state = initState, action: DocAction) {
  const { type, info } = action
  switch (type) {
    case actionTypes.SET_DOCINFO:
      return info
    default:
      return state
  }
}